package com.example.rental.mapper;

import com.example.rental.entity.Admin;
import com.example.rental.entity.User;
import com.example.rental.entity.condition.UserCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    public User getUserByUserNameAndPassword(@Param("username") String username , @Param("password") String password);

    public List<Integer> searchUserByUsername(String username);

    @Select("select * from user")
    public List<User> selectAll();

     public List<User> getUsers(@Param("condition") UserCondition userCondition);

    public Boolean deleteUserByUserid(@Param("userid") String userid);

    public void addUser(User user);

    public void updateUser(User user);
    public User selectByPhoneAndPwd(String phone, String password);
    public Integer newUser(String rphone,String rpassword);

    public User findByPhone(String phone);
}
